package cn.edu.nit.sys.controller;

import cn.edu.nit.sys.config.OperationAnnotation;
import cn.edu.nit.sys.mapper.DepartmentMapper;
import cn.edu.nit.sys.service.DepartmentService;
import cn.edu.nit.sys.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xiaobai
 * @Date 2022/8/27 21:45
 * @Version 1.0.0
 */
@RestController
@CrossOrigin
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @GetMapping
    // @PreAuthorize("hasAuthority('AMDIN')")
    @OperationAnnotation(description = "获取院系", opType = "查询")
    public R getDepartment() {
        return departmentService.getDepartmentList();
    }

}
